home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / libray / libtext / texture.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  2.6 KB  |  89 lines

  1. /*
  2.  * texture.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * texture.h,v 4.1 1994/08/09 08:03:29 explorer Exp
  17.  *
  18.  * texture.h,v
  19.  * Revision 4.1  1994/08/09  08:03:29  explorer
  20.  * Bump version to 4.1
  21.  *
  22.  * Revision 1.1.1.1  1994/08/08  04:52:15  explorer
  23.  * Initial import.  This is a prerelease of 4.0.6enh3, or 4.1 possibly.
  24.  *
  25.  * Revision 4.0  91/07/17  14:44:19  kolb
  26.  * Initial version.
  27.  * 
  28.  */
  29. #ifndef TEXTURE_H
  30. #define TEXTURE_H
  31.  
  32. #include "libobj/geom.h"
  33. #include "libsurf/surface.h"
  34. #include "mapping.h"
  35.  
  36. /*
  37.  * Surface properties
  38.  */
  39. #ifndef AMBIENT /* Check for GL definitions, and DON'T overwrite
  40.             -- for rayview */
  41. #define COLOR        0    /* AMBIENT, DIFFUSE, SPECULAR and BODY */
  42. #define AMBIENT        1
  43. #define DIFFUSE        2
  44. #define SPECULAR    3
  45. #define BODY        4
  46. #define REFLECT        5
  47. #define TRANSP        6
  48. #define SPECPOW        7
  49. #define BUMP        8
  50. #define INDEX        9
  51. #endif /* GL check */
  52.  
  53. #define TextPointToModel(p)    PointTransform(p, &model2text.itrans)
  54. #define TextPointToPrim(p)    PointTransform(p, &prim2text.itrans)
  55. #define TextPointToWorld(p)    PointTransform(p, &world2text.itrans)
  56. #define TextRayToModel(p)    RayTransform(r, &model2text.itrans)
  57. #define TextRayToPrim(r)    RayTransform(r, &prim2text.itrans)
  58. #define TextRayToWorld(r)    RayTransform(r, &world2text.itrans)
  59. #define TextNormToModel(n)    NormalTransform(n, &model2text.trans)
  60. #define TextNormToPrim(n)    NormalTransform(n, &prim2text.trans)
  61. #define TextNormToWorld(n)    NormalTransform(n, &world2text.trans)
  62.  
  63. #define ModelPointToText(p)    PointTransform(p, &model2text.trans)
  64. #define ModelNormToText(n)    NormalTransform(n, &model2text.itrans)
  65. #define ModelRayToText(r)    RayTransform(r, &model2text.trans)
  66.  
  67. typedef char *TextRef;
  68.  
  69. /*
  70.  * Texture structure
  71.  */
  72. typedef struct Texture {
  73.     TextRef data;            /* Texturing info */
  74.     void    (*method)();        /* method */
  75.     Trans    *trans;            /* transformation info */
  76.     short    animtrans;        /* is the transformation animated? */
  77.     struct Texture *next;        /* next in list */
  78. } Texture;
  79.  
  80. extern Texture    *TextCreate(), *TextAppend();
  81. extern void    DNoise3(), VfBm(), TextApply(), MakeBump(), Wrinkled();
  82. extern Float    Noise3(), Noise2(), Chaos(), Marble(), fBm();
  83. extern int    TileValue();
  84. Color        *ColormapRead();
  85.  
  86. extern Trans    model2text, prim2text, world2text;
  87.  
  88. #endif TEXTURE_H
  89.